/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PL_C_ERRNO_H
#define PL_C_ERRNO_H

#include <ansi.h>
#include <math.h>

#ifdef	__cplusplus
extern "C" {
#endif

/**
 * 
 */
#define SIOPENDING -1
/**
 * Not super-user
 */
#define	EPERM 1
/**
 * No such file or directory
 */
#define	ENOENT 2
/**
 * No such process
 */
#define	ESRCH 3
/**
 * Interrupted system call
 */
#define	EINTR 4
/**
 * I/O error
 */
#define	EIO 5
/**
 * No such device or address
 */
#define	ENXIO 6
/**
 * Arg list too long
 */
#define	E2BIG 7
/**
 * Exec format error 
 */
#define	ENOEXEC 8
/**
 * Bad file number 
 */
#define	EBADF 9
/**
 * No children 
 */
#define	ECHILD 10
/**
 * No more processes 
 */
#define	EAGAIN 11
/**
 * Not enough core 
 */
#define	ENOMEM 12
/**
 * Permission denied 
 */
#define	EACCES 13
/**
 * Bad address 
 */
#define	EFAULT 14
/** 
 * Block device required 
 */
#define	ENOTBLK 15
/**
 * Mount device busy 
 */
#define	EBUSY 16
/**
 * File exists 
 */
#define	EEXIST 17
/**
 * Cross-device link 
 */
#define	EXDEV 18
/**
 * No such device 
 */
#define	ENODEV 19
/**
 * Not a directory 
 */
#define	ENOTDIR 20
/**
 * Is a directory 
 */
#define	EISDIR 21
/**
 * Invalid argument 
 */
#define	EINVAL 22
/**
 * Too many open files in system 
 */
#define	ENFILE 23
/**
 * Too many open files 
 */
#define	EMFILE 24
/**
 * Not a typewriter 
 */
#define	ENOTTY 25
/**
 * Text file busy 
 */
#define	ETXTBSY 26
/** 
 * File too large 
 */
#define	EFBIG 27
/**
 * No space left on device 
 */
#define	ENOSPC 28
/**
 * Illegal seek 
 */
#define	ESPIPE 29
/** 
 * Read only file system 
 */
#define	EROFS 30
/**
 * Too many links 
 */
#define	EMLINK 31
/**
 * Broken pipe 
 */
#define	EPIPE 32
/**
 * Math arg out of domain of func 
 */
#define	EDOM 33
/**
 * Math result not representable 
 */
#define	ERANGE 34
/**
 * No message of desired type 
 */
#define	ENOMSG 35
/**
 * Identifier removed 
 */
#define	EIDRM 36
/** 
 * Channel number out of range 
 */
#define	ECHRNG 37
/**
 * Level 2 not synchronized 
 */
#define	EL2NSYNC 38
/**
 * Level 3 halted 
 */
#define	EL3HLT 39
/** 
 * Level 3 reset 
 */
#define	EL3RST 40
/**
 * Link number out of range 
 */
#define	ELNRNG 41
/**
 * Protocol driver not attached 
 */
#define	EUNATCH 42
/**
 * No CSI structure available 
 */
#define	ENOCSI 43
/**
 * Level 2 halted 
 */
#define	EL2HLT 44
/**
 * Deadlock condition 
 */
#define	EDEADLK 45
/**
 * No record locks available 
 */
#define	ENOLCK 46
/**
 * Invalid exchange 
 */
#define  EBADE 50
/**
 * Invalid request descriptor 
 */
#define  EBADR 51	
/**
 * Exchange full 
 */
#define  EXFULL 52
/**
 * No anode 
 */
#define  ENOANO 53
/**
 * Invalid request code 
 */
#define  EBADRQC 54
/**
 * Invalid slot 
 */
#define  EBADSLT 55
/**
 * File locking deadlock error 
 */
#define  EDEADLOCK 56
/**
 * Bad font file fmt 
 */
#define  EBFONT 57
/**
 * Device not a stream 
 */
#define  ENOSTR 60
/**
 * No data (for no delay io) 
 */
#define  ENODATA 61
/**
 * Timer expired 
 */
#define  ETIME 62
/**
 * Out of streams resources 
 */
#define  ENOSR 63
/**
 * Machine is not on the network 
 */
#define  ENONET 64
/**
 * Package not installed 
 */
#define  ENOPKG 65
/**
 * The object is remote 
 */
#define  EREMOTE 66
/** 
 * The link has been severed 
 */
#define  ENOLINK 67
/**
 * Advertise error 
 */
#define  EADV 68
/**
 * Srmount error 
 */
#define  ESRMNT 69
/**
 * Communication error on send 
 */
#define 	ECOMM 70
/**
 * Protocol error 
 */
#define  EPROTO 71
/**
 * Multihop attempted 
 */
#define	EMULTIHOP 74
/**
 * Inode is remote (not really error) 
 */
#define	ELBIN 75
/**
 * Cross mount point (not really error) 
 */
#define	EDOTDOT 76
/**
 * Trying to read unreadable message 
 */
#define  EBADMSG 77
/**
 * Inappropriate file type or format 
 */
#define  EFTYPE 79
/**
 * Given log. name not unique 
 */
#define  ENOTUNIQ 80
/**
 * f.d. invalid for this operation 
 */
#define  EBADFD 81
/**
 * Remote address changed 
 */
#define  EREMCHG 82
/**
 * Can't access a needed shared lib 
 */
#define  ELIBACC 83
/**
 * Accessing a corrupted shared lib 
 */
#define  ELIBBAD 84
/**
 * .lib section in a.out corrupted 
 */
#define  ELIBSCN 85
/**
 * Attempting to link in too many libs 
 */
#define  ELIBMAX 86
/**
 * Attempting to exec a shared library 
 */
#define  ELIBEXEC 87
/**
 * Function not implemented 
 */
#define  ENOSYS 88
/**
 * No more files 
 */
#define  ENMFILE 89
/**
 * Directory not empty 
 */
#define  ENOTEMPTY 90
/**
 * File or path name too long 
 */
#define  ENAMETOOLONG 91
/**
 * Too many symbolic links 
 */
#define  ELOOP 92
/**
 * Operation not supported on transport endpoint 
 */
#define  EOPNOTSUPP 95
/**
 * Protocol family not supported 
 */
#define  EPFNOSUPPORT 96
/**
 * Connection reset by peer 
 */
#define  ECONNRESET 104 
/**
 * No buffer space available 
 */
#define  ENOBUFS 105
/**
 * Address family not supported by protocol family 
 */
#define  EAFNOSUPPORT 106
/** 
 * Protocol wrong type for socket 
 */
#define  EPROTOTYPE 107
/**
 * Socket operation on non-socket 
 */
#define  ENOTSOCK 108
/**
 * Protocol not available
 */
#define  ENOPROTOOPT 109
/**
 * Can't send after socket shutdown 
 */
#define  ESHUTDOWN 110
/**
 * Connection refused 
 */
#define  ECONNREFUSED 111
/**
 * Address already in use 
 */
#define  EADDRINUSE 112
/**
 * Connection aborted 
 */
#define  ECONNABORTED 113
/**
 * Network is unreachable 
 */
#define  ENETUNREACH 114
/**
 * Network interface is not configured 
 */
#define  ENETDOWN 115
/**
 * Connection timed out 
 */
#define  ETIMEDOUT 116
/**
 * Host is down 
 */
#define  EHOSTDOWN 117
/**
 * Host is unreachable 
 */
#define  EHOSTUNREACH 118
/**
 * Connection already in progress 
 */
#define  EINPROGRESS 119
/**
 * Socket already connected 
 */
#define  EALREADY 120
/**
 * Destination address required 
 */
#define  EDESTADDRREQ 121
/**
 * Message too long 
 */
#define  EMSGSIZE 122
/**
 * Unknown protocol 
 */
#define  EPROTONOSUPPORT 123
/**
 * Socket type not supported 
 */
#define  ESOCKTNOSUPPORT 124
/**
 * Address not available 
 */
#define  EADDRNOTAVAIL 125
/**
 *
 */
#define  ENETRESET 126
/**
 * Socket is already connected 
 */
#define  EISCONN 127
/**
 * Socket is not connected 
 */
#define  ENOTCONN 128
/**
 *
 */
#define  ETOOMANYREFS 129
/**
 *
 */
#define  EPROCLIM 130
/**
 *
 */
#define  EUSERS 131
/**
 *
 */
#define  EDQUOT 132
/**
 *
 */
#define  ESTALE 133
/**
 * Not supported 
 */
#define  ENOTSUP 134
/**
 * No medium (in tape drive) 
 */
#define  ENOMEDIUM 135
/**
 * No such host or network path 
 */
#define  ENOSHARE 136
/**
 * Filename exists with different case 
 */
#define  ECASECLASH 137
/**
 *
 */
#define  EILSEQ 138
/**
 * Value too large for defined data type 
 */
#define  EOVERFLOW 139

#define errno (*__errno())

extern int *__errno(void);

#ifndef __error_t_defined
typedef int error_t;
#define __error_t_defined 1
#endif

extern const char * __sys_errlist[];

#ifdef	__cplusplus
}
#endif
		
#endif // PL_C_ERRNO_H
